#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>

int main(){
    time_t timep;
    int cnt, evenT = 0, oddT = 0, seed = time(&timep);
    int deno = 0;
    double proba;
    printf("Please enter the count: ");
    scanf("%d", &cnt);
    printf("Please enter the deno you want: ");
    scanf("%d", &deno);
    for(int i = 1; i <= cnt; i++){
        srand(seed);
        bool a = rand() % deno == 0;
        a ? evenT++ : oddT++;
        proba = (double)evenT / (double)i;
        printf("%d\t%d\t%d\t%.5f\n", a, evenT, oddT, proba);
        seed++;
    }
    printf("Executed %d times. The Frequency is %.10f:", cnt, proba);
    return 0;
}